<template>
	<div class="index">

    <div style="position: fixed; left: 0; bottom: 0; width:100vw; font-size: 14px; background: #fff; z-index: 999; border-radius: 0.2rem 0.2rem 0 0; ">

      <div class="flex" >
        <div style="flex: 1; height: 1rem;" class="flexcc">
          <div @click="goshangcheng('/index')">
            <div class="flexcc"  :class="act == 1?'navtitleact':'navtitle'"><img src="../../../static/img/jiameng0.svg" style="width: 0.3rem; margin-bottom: 0.05rem;"></div>
            <div :class="act == 1?'lan':'hui'">商城</div>
          </div>
        </div>

        <div style="flex: 1; height: 1rem;" class="flexcc"  >
          <div @click="gohoutai('/geren')">
            <div  class="flexcc"  :class="act == 2?'navtitleact':'navtitle'"><img src="../../../static/img/jiameng1.svg" style="width: 0.3rem; margin-bottom: 0.05rem;"></div>
            <div :class="act == 2?'lan':'hui'">我的</div>
          </div>
        </div>
      </div>

    </div>

	</div>
</template>

<script>
  var h = document.documentElement.clientWidth / 7.5 + 'px';
  document.documentElement.style.fontSize = h;
	export default {
		name: 'footers',
		data() {
			return {
        all:"",
        act:2
			}
		},
		created() {

		},
		mounted() {
      if(location.pathname.includes('index')){
        this.act = 1
      }
		},
		methods: {
      goshangcheng:function(){
        axios.get('/agent/auth/user').then((response)=>{
        	if (response.data.msg.code == 0) {
            let url = location.origin + '/h5'
            location.href = location.origin + '/h5?shop_id=' + window.btoa(response.data.data.id)
    
        	}else {
            vant.Toast(response.data.msg.info);
            this.$router.push({
              path:'/jiameng'
            })
        	}
        })
      },
      gohoutai:function(){
        axios.get('/agent/auth/user').then((response)=>{
        	if (response.data.msg.code == 0) {
            window.location.href = location.origin + '/web'
        	}else {
            vant.Toast(response.data.msg.info);
            this.$router.push({
              path:'/jiameng'
            })
        	}
        })
      }

		}
	}
</script>


<style scoped lang="less">
  .index{
    .navtitleact{
      img{
        filter: drop-shadow(rgb(0, 90, 255) 10000px 0);
        transform: translateX(-10000px);
        position: relative;
        top: -1px;
      }
    }
    .navtitle{
      img{
        filter: drop-shadow(rgb(175, 179, 188) 10000px 0);
        transform: translateX(-10000px);
        position: relative;
        top: -1px;
      }
    }

    .lan{ color: rgb(0, 90, 255);}
    .hui{color: rgb(175, 179, 188);}
  }
</style>
